package com.xiaoyao.novel.action.page;

import org.apache.log4j.Logger;

import com.xiaoyao.novel.pojo.WebInfo;
import com.xiaoyao.novel.service.WebInfoService;

public class WebInfoAction extends BaseAction {

	private static Logger logger = Logger.getLogger(WebInfoAction.class);
	private static final long serialVersionUID = 1L;
	static WebInfoService webInfoService = new WebInfoService();
	WebInfo webInfo = null;

	@Override
	public String execute() throws Exception {
		request.setAttribute("webInfo", webInfoService.getStaticWebInfo());
		return SUCCESS;
	}
 

	public String update() throws Exception {
		request.setAttribute("configInfo", webInfo);
		logger.info("修改配置:" + webInfo);
		webInfoService.update(webInfo);
		request.setAttribute("msg", "修改配置成功!");
		return SUCCESS;
	}

	public static Logger getLogger() {
		return logger;
	}

	public static void setLogger(Logger logger) {
		WebInfoAction.logger = logger;
	}

	public static WebInfoService getConfigInfoService() {
		return webInfoService;
	}

	public static void setConfigInfoService(WebInfoService configInfoService) {
		WebInfoAction.webInfoService = configInfoService;
	}

	public WebInfo getWebInfo() {
		return webInfo;
	}

	public void setWebInfo(WebInfo webInfo) {
		this.webInfo = webInfo;
	} 

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
}
